<CFPARAM NAME="sMess" DEFAULT="">
<CFPARAM NAME="sWarn" DEFAULT="">

<CFIF sMess NEQ "">
	<CFOUTPUT>
	<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TITLE="Information">
	<B>#sMess#</B><BR>
	<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TOP="False">
	</CFOUTPUT>
</CFIF>
<CFIF sWarn NEQ "">
	<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TITLE="There was a problem!">
		<CFOUTPUT>
			<BR><FONT COLOR="##FF0000"><B>#sWarn#</B></FONT><BR>
				<A HREF="javascript:history.back()">Back to Previous Screen</A>
		</CFOUTPUT>
	<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TOP="False">
<CFELSE>
	<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TITLE="Browse eWorkSked">
	<CFSET URL.ID=DECRYPT(url.id,CLIENT.EK)>
	
	<CFOUTPUT>
	<FORM ACTION="#getfilefrompath(getbasetemplatepath())#?id=#sIDUrlEnc#" METHOD="post" NAME="frmIndex">
	</CFOUTPUT>
	<CFSET lstAddtnlButton = "">
	<CFIF fieldISADD EQ "Y">
		<CFSET lstAddtnlButton = "btnISADD~New~New">
	</CFIF>
	<CFSET lstOrder="Document Number~WSNUMBER~ftString,Description~DESCRIPTION~ftString">
	<CFSET frmname="frmbrwmovement">
	<CFQUERY NAME="QueryView" DATASOURCE="#client.company_dsn#">
		SELECT * FROM CINWORKSCHED
		WHERE WSCODE_FK = '#sID#'
		<CFIF getECRG.ISSHARED NEQ "Y">
			AND RECCREATEDBY ='#client.userid#'
		</CFIF>
		<CFIF ISDEFINED("FORM.FILTER")>
			AND #FORM.CMBSORT# LIKE '%#FORM.EDTVALFILTER#%'
			ORDER BY #FORM.CMBSORT# #FORM.ASCDESC#
		<CFELSE>
			ORDER BY WSNUMBER DESC, DESCRIPTION
		</CFIF>
	</CFQUERY>
	<CFINCLUDE template="#client.common_path#/toolbar.cfm">
	<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=2 WIDTH="100%">
		<CFOUTPUT>
			<TR BGCOLOR="#client.color_tblhead#" ALIGN="CENTER">
				<TD WIDTH="20%"></TD>
				<TD CLASS="boldwhite">Document No.</TD>
				<TD CLASS="boldwhite">Description</TD>
				<TD CLASS="boldwhite">Date Endorsed</TD>
				<TD CLASS="boldwhite">Posted</TD>
			</TR>
			</CFOUTPUT>
		<CFIF QueryView.recordcount GT 0>
			<CFSET actEdit=urlEncodedFormat(encrypt("edit", client.ek))>
			<CFSET actCopy=urlEncodedFormat(encrypt("copy", client.ek))>
			<CFSET actDelete=urlEncodedFormat(encrypt("delete", client.ek))>
			<CFOUTPUT QUERY="QueryView" STARTROW="#nStartrow#" MAXROWS="#Evaluate(nEndrow - nStartrow + 1)#">
				<CFSET sPosted = "No">
				<CFIF QueryView.APPROVED EQ "S" OR QueryView.APPROVED EQ "N" OR QueryView.APPROVED EQ "Y">
					<CFSET sPosted = "Yes">
				</CFIF>
				<CFSET actPosted = URLEncodedFormat(encrypt(sPosted,client.ek))>
				<CFSET idDetVal = urlEncodedFormat(encrypt(WSNUMBER, client.ek))>
				<TR BGCOLOR="#IIf(CurrentRow Mod 2, "client.color_tblset2", "client.color_tblset1")#" VALIGN="top">
					<TD NOWRAP CLASS="regular11" WIDTH=135>&nbsp;
						<CFIF fieldISEDIT EQ "Y" AND sPosted EQ "NO">
							<A HREF="#getfilefrompath(getbasetemplatepath())#?id=#sIDUrlEnc#&wsnum=#idDetVal#&myAction=#actEdit#&posted=#actPosted#" CLASS="regular11">edit</A>&nbsp;
						</CFIF>
						<CFIF fieldISVIEW EQ "Y">
							<A HREF="#getfilefrompath(getbasetemplatepath())#?id=#sIDUrlEnc#&wsnum=#idDetVal#&myAction=#actEdit#&posted=#actPosted#&view=" CLASS="regular11">view</A>&nbsp;
						</CFIF>
						<CFIF fieldISCOPY EQ "Y">
							<A HREF="#getfilefrompath(getbasetemplatepath())#?id=#sIDUrlEnc#&wsnum=#idDetVal#&myAction=#actCopy#&posted=#actPosted#" CLASS="regular11">copy</A>&nbsp;
						</CFIF>
						<CFIF sPosted NEQ "Yes">
							<CFIF fieldISDELETE EQ "Y">
								<A HREF="#getfilefrompath(getbasetemplatepath())#?id=#sIDUrlEnc#&wsnum=#idDetVal#&myAction=#actDelete#" ONCLICK="javascript: return confirmThis('Delete this eWorkSked File?');" CLASS="regular11">delete</A>&nbsp;
							</CFIF>
						</CFIF>
					</TD>
					<TD>#WSNUMBER#</TD>
					<TD>#DESCRIPTION#</TD>
					<TD>#DATEFORMAT(RECDATECREATED,"mm/dd/yyyy")#</TD>
					<TD>#sPosted#</TD>
				</TR>
			</CFOUTPUT> 
		<CFELSE>
			<TR>
				<TD COLSPAN=2 align="center"><b>No Records Found</b></TD>
			</TR>
		</CFIF>
		<CFOUTPUT>
			<TR BGCOLOR="#client.color_tblfoot#">
					<TD COLSPAN=8	CLASS="boldwhite" HEIGHT=18>&nbsp;#QueryView.RecordCount# records found.</TD>
			</TR>
		</CFOUTPUT>
	</TABLE>
	<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TOP="False">
</CFIF>
